import request from '@/utils/request'
const pubpar={
  tenant: "pico"
}
export function login(data) {
  return request({
    url: '/adm/v1/auth/login',
    method: 'post',
    data:{
      ...data,
      ...pubpar,
    }
  })
}

export function getInfo() {
  return request({
    url: '/adm/v1/employee/profile',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/vue-element-admin/user/logout',
    method: 'post'
  })
}

// 获取用户管理列表
export function getCustomerList(data) {
  return request({
    url: '/adm/v1/customer/list',
    method: 'get',
    params: data
  })
}

// 获取用户代理区域列表
export function getAgentCustomerList(data) {
  return request({
    url: '/p/adm/v1/agent/area/list',
    method: 'get',
    params: data
  })
}

// 获取用户详情
export function getCustomerDetail(id) {
  return request({
    url: `/adm/v1/customer/detail/${id}`,
    method: 'get',
  })
}

// 获取用户钱包流水
export function userWalletTrans(data) {
  return request({
    url: '/adm/v1/wallet/trans',
    method: 'get',
    params: data
  })
}

// 改变合伙人权限
export function modifyIntroducer(data) {
  return request({
    url: '/adm/v1/customer/introducer/switch',
    method: 'put',
    data
  })
}

//获取省级地区
export function getProvince() {
  return request({
    url: `/v1/common/province`,
    method: 'get'
  })
}

//获取市级地区 data:{provinceId:123}
export function getCity(data) {
  return request({
    url: `/v1/common/city`,
    method: 'get',
    params: data
  })
}

//获取县级地区 data:{cityId:123}
export function getCounty(data) {
  return request({
    url: `/v1/common/area`,
    method: 'get',
    params: data
  })
}